package leecode

func subtractProductAndSum(n int) int {
	var (
		sum int
		acc int = 1
	)
	for n > 0 {
		temp := n % 10
		n = n / 10
		sum += temp
		acc *= temp
	}
	return acc - sum
}
